#ifndef _NS2009_H_
#define _NS2009_H_

#include <stdint.h>
#include <stdbool.h>


#ifdef __cplusplus
extern "C" {
#endif

#define NS2009_ADDR 0x48

#define NS2009_LOW_POWER_READ_X  0xc0
#define NS2009_LOW_POWER_READ_Y  0xd0
#define NS2009_LOW_POWER_READ_Z1 0xe0
#define NS2009_LOW_POWER_READ_Z2 0xf0

#define SCREEN_X_PIXEL 320
#define SCREEN_Y_PIXEL 480

uint8_t  ns2009_init(void);
uint32_t ns2009_read(const uint8_t _cmd);
uint32_t ns2009_getPress(void);
uint32_t bsp_ns2009_getPos(uint32_t* _pos);
void     ns2009_test(void);
bool     ns2009_is_pressed(void);
void     ns2009_get_xy(uint16_t* x, uint16_t* y);
void     ns2009_read_adc(uint32_t* x_adc, uint32_t* y_adc);


#ifdef __cplusplus
}
#endif

#endif /* _NS2009_H_ */
